<template>
  <div class="container">
    <div class="title">微信授权提示</div>
    <div class="content">
      <div>因提现仅支持微信到账，提现前请先授权绑定微信 账号</div>
      <div>绑定微信账号后，可以获取订单出售、纠纷等 推送信息。</div>
    </div>
    <div @click="authorizate" class="authorization">微信授权</div>
  </div>
</template>

<script>
import { bind_wechat_post } from '@/api/app/seller'
import { Notify } from 'vant'

export default {
  methods: {
    authorizate() {
      const token = localStorage.getItem('wechatToken')
      bind_wechat_post({
        data: { token },
        headers: { 'Content-Type': 'application/x-www-form-urlencoded' }
      }).then((data) => {
        Notify({
          type: 'success',
          message: '微信授权成功',
          onClose: () => {
            this.$router.push('/myCenter')
          }
        })
      })
    }
  }
}
</script>

<style lang="scss" scoped src="./styles/index.scss"></style>
